package com.gitee.dupe.authority.dto;

import com.baomidou.mybatisplus.annotation.TableField;
import com.gitee.dolt.core.base.entity.SuperEntity;
import com.gitee.dupe.authority.enumeration.RoleResourceScopeEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.util.Set;

/**
 * @author LYH
 */
@Data
public class RoleSaveDTO {

    @NotNull(message = "id不能为空", groups = SuperEntity.Update.class)
    @Null(message = "id必需为空", groups = SuperEntity.Save.class)
    private Long id;

    /**
     * 标识
     */
    @ApiModelProperty(value = "标识")
    @Length(max = 255)
    private String ident;

    /**
     * 名称
     */
    @ApiModelProperty(value = "名称", required = true)
    @NotBlank
    @Length(max = 50)
    private String name;

    /**
     * 是否可用
     */
    @ApiModelProperty(value = "是否启用", required = true)
    @NotNull
    private Boolean enabled;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    @Length(max = 255)
    private String remark;

    /**
     * 作用域
     */
    @ApiModelProperty(value = "作用域")
    private RoleResourceScopeEnum scope;

    @ApiModelProperty(value = "权限id", notes = "保存更新时用")
    private Set<Long> resourceIds;

}
